<template>
  <!-- 全屏组件 -->
  <div>
    <svg-icon icon-class="fullscreen" @click="changScreen" />
  </div>
</template>

<script>
import Screenfull from 'screenfull'

export default {
  methods: {
    changScreen() {
      if (!Screenfull.isEnabled) {
      // 此时全屏不可用
        this.$message.warning('此时全屏不可用')
        return
      }
      // 如果可用就全屏
      Screenfull.toggle()
    }
  }
}
</script>
